import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 保存token
    token: null,
    // 保存左侧导航状态
    activecai: null,
  },
  mutations: {
    // 初始化token
    inittoken(state, token) {
      state.token = token
    },
    // 初始左侧高亮
    initactivecai(state, activecai) {
      state.activecai = activecai
    },

  },
  actions: {
  },
  modules: {
  },
  plugins: [createPersistedState()],

})
